import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { WechatService } from '../../providers/wechat.service';

/**
 * Generated class for the TestPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-test',
  templateUrl: 'test.html',
})
export class TestPage {
  dailyTask:any;

  constructor(public navCtrl: NavController, public navParams: NavParams, private wechatService:WechatService) {
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad TestPage');
    this.dailyTask = [{}, {}, {}];
    for (var i=0; i<this.dailyTask.length; i++) {
      let item:Object = this.dailyTask[i];
      item['show'] = false;
    }
  }

  scroll() {
    
  }
  onClick() {
    // let data = {'shareTit':"好友分享", 'shareDesc':'详情描述', 'shareImg':'', 'shareUrl':'https:www.baidu.com'}
    // this.wechatService.shareWxSession(data);

    this.navCtrl.push('TixianPage')
  }

  toggleGroup(group) {
    group.show = !group.show;
  };
  
  isGroupShown(group) {
    return group.show;
  };

}
